/****** Object:  Stored Procedure dbo.spr_UpdateDBCarAssignByPK  ******/

 use [TourIS]
 GO

 if exists (select * from dbo.sysobjects where id = object_id(N'[dbo].[spr_UpdateDBCarAssignByPK]') and OBJECTPROPERTY(id, N'IsProcedure') = 1)
 drop procedure [dbo].[spr_UpdateDBCarAssignByPK]
 GO

 SET QUOTED_IDENTIFIER OFF
 GO
 SET ANSI_NULLS OFF
 GO

 CREATE  PROCEDURE [dbo].[spr_UpdateDBCarAssignByPK]
 (
	@carid int,
	@compid int,
	@driverid int,
	@fineamount int,
	@finetype varchar(50),
	@forclientid int,
	@forempid int,
	@srno int,
	@takenfrom smalldatetime,
	@takentill smalldatetime
 )

 AS

 BEGIN
	SET NOCOUNT ON
	DECLARE @Err int

	UPDATE [CarAssign]
	SET
		[CarId] = @carid,
		[CompId] = @compid,
		[DriverId] = @driverid,
		[FineAmount] = @fineamount,
		[FineType] = @finetype,
		[ForClientId] = @forclientid,
		[ForEmpId] = @forempid,
		[SrNo] = @srno,
		[TakenFrom] = @takenfrom,
		[TakenTill] = @takentill

	WHERE
	[CompId] = @compid
	AND [SrNo] = @srno


	SET @Err = @@Error
	RETURN @Err
 END

 SET QUOTED_IDENTIFIER OFF
 GO
 SET ANSI_NULLS ON
 GO

